package edu.java.texbooks.scjp.test05;

public class SpecialStudent extends Student implements
	Comparable<SpecialStudent> {

    public SpecialStudent(String name, int[] marks) {
	super(name, marks);

    }

    @Override
    public int compareTo(SpecialStudent specStudent) {
	if (specStudent == null) {
	    throw new IllegalArgumentException(
		    "Null-pointed object in compareTo method");
	}
	return this.getName().compareTo(specStudent.getName());
    }

    public int compareTo2(SpecialStudent specStudent) {
	if (specStudent == null) {
	    throw new IllegalArgumentException(
		    "Null-pointed object in compareTo2 method");
	}
	return (int) (this.getAverageResults() - specStudent
		.getAverageResults());
    }

}
